home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form frmMailingList
- BorderStyle = 1 'Fixed Single
- Caption = "Mailing List Application"
- ClientHeight = 3375
- ClientLeft = 45
- ClientTop = 345
- ClientWidth = 7875
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 3375
- ScaleWidth = 7875
- StartUpPosition = 3 'Windows Default
- Begin VB.Frame fraTime
- Caption = "Elapsed Time"
- Height = 3135
- Left = 5760
- TabIndex = 7
- Top = 120
- Width = 2055
- Begin VB.Timer timSeconds
- Enabled = 0 'False
- Interval = 1000
- Left = 120
- Top = 840
- End
- Begin VB.CommandButton cmdExit
- Caption = "E&xit"
- Height = 495
- Left = 480
- TabIndex = 17
- Top = 2520
- Width = 1215
- End
- Begin VB.CommandButton cmdPause
- Caption = "&Pause"
- Enabled = 0 'False
- Height = 495
- Left = 480
- TabIndex = 16
- Top = 1920
- Width = 1215
- End
- Begin VB.CommandButton cmdStart
- Caption = "&Start"
- Height = 495
- Left = 480
- TabIndex = 15
- Top = 1320
- Width = 1215
- End
- Begin VB.Label lblElapsedTime
- Alignment = 2 'Center
- BackColor = &H00FFFFFF&
- BorderStyle = 1 'Fixed Single
- Caption = "00:00:00"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 13.5
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 495
- Left = 240
- TabIndex = 14
- Top = 360
- Width = 1575
- End
- End
- Begin VB.Frame fraMail
- Caption = "Address Information"
- Enabled = 0 'False
- Height = 3135
- Left = 120
- TabIndex = 0
- Top = 120
- Width = 5535
- Begin VB.TextBox txtInput
- Height = 375
- Index = 4
- Left = 3960
- TabIndex = 5
- Top = 1800
- Width = 1455
- End
- Begin VB.TextBox txtInput
- Height = 375
- Index = 3
- Left = 960
- TabIndex = 4
- Top = 1800
- Width = 2055
- End
- Begin VB.TextBox txtInput
- Height = 375
- Index = 2
- Left = 960
- TabIndex = 3
- Top = 1320
- Width = 4455
- End
- Begin VB.TextBox txtInput
- Height = 375
- Index = 1
- Left = 960
- TabIndex = 2
- Top = 840
- Width = 4455
- End
- Begin VB.TextBox txtInput
- Height = 375
- Index = 0
- Left = 960
- TabIndex = 1
- Top = 360
- Width = 4455
- End
- Begin VB.CommandButton cmdClear
- Caption = "&Clear"
- Height = 495
- Left = 3120
- TabIndex = 13
- Top = 2400
- Width = 1215
- End
- Begin VB.CommandButton cmdAccept
- Caption = "&Accept"
- Height = 495
- Left = 1560
- TabIndex = 6
- Top = 2400
- Width = 1215
- End
- Begin VB.Label Label5
- Caption = "Zip"
- Height = 375
- Left = 3240
- TabIndex = 12
- Top = 1800
- Width = 1215
- End
- Begin VB.Label Label4
- Caption = "State"
- Height = 375
- Left = 120
- TabIndex = 11
- Top = 1800
- Width = 1215
- End
- Begin VB.Label Label3
- Caption = "City"
- Height = 375
- Left = 120
- TabIndex = 10
- Top = 1320
- Width = 1215
- End
- Begin VB.Label Label2
- Caption = "Address"
- Height = 375
- Left = 120
- TabIndex = 9
- Top = 840
- Width = 1215
- End
- Begin VB.Label Label1
- Caption = "Name"
- Height = 375
- Left = 120
- TabIndex = 8
- Top = 360
- Width = 1215
- End
- End
- Attribute VB_Name = "frmMailingList"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- Dim ElapsedTime As Variant
- Dim LastNow As Variant
- Private Sub cmdAccept_Click()
- Dim S As String, I As Integer
- 'Accept button clicked - form label and output in message box
- 'Make sure each text box has entry
- For I = 0 To 4
- If txtInput(I).Text = "" Then
- MsgBox "Each box must have an entry!", vbInformation + vbOKOnly, "Error"
- Exit Sub
- End If
- Next I
- S = txtInput(0).Text + vbCrLf + txtInput(1).Text + vbCrLf
- S = S + txtInput(2).Text + ", " + txtInput(3).Text + " " + txtInput(4).Text
- MsgBox S, vbOKOnly, "Mailing Label"
- Call cmdClear_Click
- End Sub
- Private Sub cmdClear_Click()
- Dim I As Integer
- 'Clear all text boxes
- For I = 0 To 4
- txtInput(I).Text = ""
- Next I
- txtInput(0).SetFocus
- End Sub
- Private Sub cmdExit_Click()
- 'Exit button clicked
- End Sub
- Private Sub cmdPause_Click()
- 'Pause button clicked
- 'Disable pause button
- 'Enabled start and exit buttons
- cmdPause.Enabled = False
- cmdStart.Enabled = True
- cmdExit.Enabled = True
- 'Stop timer
- timSeconds.Enabled = False
- 'Disable editing frame
- fraMail.Enabled = False
- End Sub
- Private Sub cmdStart_Click()
- 'Start button clicked
- 'Disable start and exit buttons
- 'Enabled pause button
- cmdStart.Enabled = False
- cmdExit.Enabled = False
- cmdPause.Enabled = True
- 'Establish start time and start timer control
- LastNow = Now
- timSeconds.Enabled = True
- 'Enable mailing list frame
- fraMail.Enabled = True
- txtInput(0).SetFocus
- End Sub
- Private Sub Form_Load()
- ElapsedTime = 0
- End Sub
- Private Sub timSeconds_Timer()
- 'Increase elapsed time and display
- ElapsedTime = ElapsedTime + Now - LastNow
- lblElapsedTime.Caption = Format(ElapsedTime, "hh:mm:ss")
- LastNow = Now
- End Sub
- Private Sub txtInput_KeyPress(Index As Integer, KeyAscii As Integer)
- Dim NextIndex As Integer
- 'Check for return key
- If KeyAscii = vbKeyReturn Then
- NextIndex = Index + 1
- If NextIndex > 4 Then
- cmdAccept.SetFocus
- Else
- txtInput(NextIndex).SetFocus
- End If
- End If
- 'In Zip text box, make sure only numbers or backspace pressed
- If Index = 4 Then
- If (KeyAscii >= Asc("0") And KeyAscii <= Asc("9")) Or KeyAscii = vbKeyBack Then
- Exit Sub
- Else
- KeyAscii = 0
- End If
- End If
- End Sub
-